﻿$(function () {
    //document.write('<script type="text/javascript" src="/scripts/jquery/jquery-1.10.2.min.js"></script>');
    initData();
});

//初始化数据
function initData() {
    $.ajax({
        type: "post",
        url: "/Interface/Statistics.ashx?action=collectdata",
        data: {//传入参数
            "domainname": window.location.host,
            "urlStr": window.location.href
        },
        dataType: "json",
        beforeSend: function (XMLHttpRequest) {
            //发送前动作
        },
        success: function (data, textStatus) {
            if (data.status == -1) {//data.status为返回状态 1 成功 -1 网站过期
                alert(data.msg);
                location.href = data.url;
            }
            return;
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert("状态：" + textStatus + "；出错提示：" + errorThrown);
        },
        timeout: 100000
    });
}